//使用直接字面量，声明对象
let student = {
    name: '毛毛',
    age: 22,
    gender: '男',
    //show方法
    show: function () {
        document.write('name=' + this.name + 'age=' + this.age + 'gender=' + this.gender + '<br/>')
    }
}
//对象的使用
student.show();
//可以修改对象的属性值
student.age = 20;
student.show();
//获得对象的属性值
console.log(student.name);


//狗对象
let dog = {
    name: '旺财',
    age: 3,
    eat() {
        console.log('name=' + this.name + 'age=' + this.age);
    }
}
dog.eat();

